<template>
  <div class="dashboard-editor-container">
    <el-card class="chart-card">
      <template #header>
        <div class="chart-header">
          <span>柱状图数据可视化</span>
        </div>
      </template>

      <el-row :gutter="32">
        <el-col :xs="24" :sm="24" :lg="12">
          <div class="chart-wrapper">
            <bar-chart />
          </div>
        </el-col>
        <el-col :xs="24" :sm="24" :lg="12">
          <div class="chart-description">
            <h3>柱状图说明</h3>
            <p>柱状图是一种用于比较不同类别数据大小的图表。通过使用高度不同的柱形来表示不同类别的数值，可以直观地比较各类别之间的差异。</p>
            <p>在本系统中，柱状图主要用于展示不同类别数据的对比情况，如不同产品的销售量对比、不同月份的收入对比等。</p>
            <div class="chart-features">
              <h4>柱状图特点：</h4>
              <ul>
                <li>直观比较不同类别数据的大小</li>
                <li>适合展示离散型数据的对比</li>
                <li>可以清晰展示数据的差异和趋势</li>
                <li>支持垂直和水平两种展示方式</li>
              </ul>
            </div>
          </div>
        </el-col>
      </el-row>
    </el-card>
  </div>
</template>

<script>
import BarChart from '@/views/dashboard/BarChart'

export default {
  name: 'BarChartView',
  components: {
    BarChart
  }
}
</script>

<style lang="scss" scoped>
.dashboard-editor-container {
  padding: 20px;
  background-color: #f5f7fa;
  min-height: calc(100vh - 60px);
}

.chart-card {
  margin-bottom: 20px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.chart-header {
  font-size: 18px;
  font-weight: bold;
  color: #1f2937;
  display: flex;
  align-items: center;
}

.chart-wrapper {
  background: #fff;
  padding: 16px;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.chart-description {
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 4px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;

  h3 {
    margin-top: 0;
    color: #333;
    font-size: 16px;
    margin-bottom: 15px;
  }

  p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #666;
  }

  h4 {
    color: #333;
    font-size: 14px;
    margin-bottom: 10px;
  }

  ul {
    margin: 0;
    padding-left: 20px;

    li {
      margin-bottom: 8px;
      line-height: 1.5;
      color: #666;
    }
  }
}

@media (max-width: 768px) {
  .dashboard-editor-container {
    padding: 10px;
  }
  
  .chart-header {
    font-size: 16px;
  }
  
  .chart-wrapper {
    margin-bottom: 20px;
  }
}
</style>